%.bin: %.asm
	nasm -f bin $< -o $@

master.img: boot.bin loader.bin
	yse | bximage -q -hd=16 -mode=create -imgmode=flat -sectsize=512 master.img
	dd if=boot.bin of=master.img bs=512 count=1 conv=notrunc
	dd if=loader.bin of=master.img bs=512 count=4 seek=2 conv=notrunc

.PHONY: clean
clean:
	rm -f *.bin
	rm -f *.img
	rm -f *.ini

.PHONY: bochs
bochs: master.img
	bochs -q